<!--
    @name: index
    @author: kahu4
    @date: 2023-10-16 17:17
    @description：index
    @update: 2023-10-16 17:17
-->
<script setup lang="ts">
import request from '~/utils/request';
import { useAppStore } from '~/store/modules/appStore';

definePageMeta({
  middleware: ['auth-middleware']
});

const appStore = useAppStore();
const addCount = () => {
  appStore.setCount(appStore.count + 1);
};

const getData = async () => {
  const data: any = await request.get('https://api.github.com/search/users?q=aa');
  console.log(data.value);
};
</script>

<template>
  <div>
    <h2>Home 页面</h2>
    <NuxtLink to="/">index页面{{ appStore.count }}</NuxtLink>
    <div @click="getData">获取data</div>
    <div @click="addCount">+1</div>
  </div>
</template>

<style scoped></style>
